home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games: 500 MB Amiga Software
/
500 MB Amiga Software - Euber 130 - Amiga Games Disc & Mag.iso
/
userbox
/
publicdomain
/
filer
/
rexx
/
filertm.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-06-09
|
4KB
|
111 lines
/*
$VER: FilerTM.rexx 1.1 (08.06.94)
Author:
Michael Böhnisch (billy@uni-paderborn.de) (mb)
Function:
Makes FilerCom functionality available to ToolManager® dock icons.
Call:
FilerTM Load Filer if necessary and pop it to front
FilerTM dir1 Additionally read in source directory dir1
FilerTM dir1 dir2 Additionally read in both directories
FilerTM path/file Read path in source directory then perform
default action to file
History:
30.05.94 1.0 Initial Release (mb)
06.06.94 1.1 Now allows up to 10 Project/Tool icons
to be dropped simultaneously on the TM
dock icon. (mb)
*/
PARSE ARG Object.1 Object.2 Object.3 Object.4 Object.5 Object.6 Object.7 Object.8 Object.9 Object.10 .
/* -------------------------------------------------------------------- */
/* Start Filer if not already running. */
/* -------------------------------------------------------------------- */
IF ~SHOW( 'P', 'FilerRexx' ) THEN DO
ADDRESS COMMAND
'Run >NIL: Filer'
/* ---------------------------------------------------------------- */
/* Wait up to 50 seconds for Filer's AReXX port, time out if it */
/* does not show up after this period. */
/* ---------------------------------------------------------------- */
DO 5 WHILE ~SHOW( 'P', 'FilerRexx' )
'WaitForPort FilerRexx'
END
IF RC = 5 THEN DO
SAY 'Unable to load Filer'
EXIT
END
END
/* -------------------------------------------------------------------- */
/* By reaching this point Filer should be up'n running. Pull the screen */
/* to the front and respond to the arguments */
/* -------------------------------------------------------------------- */
ADDRESS 'FilerRexx'
FILERTOFRONT
IF Object.1 ~= "" THEN DO /* Are there any arguments at all? */
/* ---------------------------------------------------------------- */
/* Load rexxsupport function host if not already present */
/* ---------------------------------------------------------------- */
IF ~SHOW( 'L', 'rexxsupport.library' ) THEN DO
ADDLIB( 'rexxsupport.library', 0, -30, 0 )
END
/* ---------------------------------------------------------------- */
/* Get type of arguments and react depending to the type */
/* ---------------------------------------------------------------- */
IF LEFT( STATEF( Object.1 ), 1 ) = 'D' THEN DO
/* ------------------------------------------------------------ */
/* First argument is a directory */
/* ------------------------------------------------------------ */
READSOURCEDIR Object.1
IF Object2 ~= "" THEN DO
IF LEFT( STATEF( Object.2 ), 1 ) = 'D' THEN DO
/* ---------------------------------------------------- */
/* Second argument valid and is a directory */
/* ---------------------------------------------------- */
READTARGETDIR Object.2
OTHERDIR
END
END
END
ELSE DO
/* ------------------------------------------------------------ */
/* First argument is a file, ignore other argument(s) */
/* ------------------------------------------------------------ */
DO i = 1 TO 10
IF Object.i ~= "" THEN DO
divpos = MAX( LASTPOS( ':', Object.i ), LASTPOS( '/', Object.i ) ) + 1
READSOURCEDIR STRIP( LEFT( Object.i, divpos - 1 ), 'T', '/' )
SELECTENTRY SUBSTR( Object.i, divpos )
ACTION
END
END
END
END